/**
 * 
 */
package prototipo.server.db;

import prototipo.server.db.exception.ExceptionDB;
import prototipo.server.logic.exception.ExceptionLogic;
import prototipo.server.logic.item.ProductIF;
import prototipo.server.logic.item.RawIF;
import prototipo.server.logic.person.ClientIF;
import prototipo.server.logic.person.Supplier;
import prototipo.server.logic.person.SupplierIF;
import prototipo.server.logic.transaction.InputIF;
import prototipo.server.logic.transaction.OutputIF;
import prototipo.server.logic.user.User;
import prototipo.server.logic.user.UserIF;
import prototipo.server.logic.util.PasswordIF;

/**
 * @author cayo
 * 
 */
public interface DBControllerIF {

	UserIF getUser(String login, PasswordIF password) throws ExceptionDB,
			ExceptionLogic;

	int saveUser(UserIF newUser) throws ExceptionDB;

	boolean removeUser(int userID) throws ExceptionDB;

	boolean editUser(int userID, UserIF editedUser) throws ExceptionDB;

	boolean editSupplier(long supplierID, SupplierIF editedSupplier)
			throws ExceptionDB;

	long saveSupplier(SupplierIF newSupplier) throws ExceptionDB;

	boolean removeSupplier(long supplierID) throws ExceptionDB;

	boolean removeClient(long clientID) throws ExceptionDB;

	long saveClient(ClientIF newClient) throws ExceptionDB;

	boolean editClient(long clientID, ClientIF editedClient) throws ExceptionDB;

	long saveProduct(ProductIF newProduct) throws ExceptionDB;

	boolean removeProduct(int productID) throws ExceptionDB;

	boolean removeRaw(int rawID) throws ExceptionDB;

	int decrementRaw(int rawID, int quant) throws ExceptionDB;

	int decrementProduct(int productID, int quant) throws ExceptionDB;

	boolean editRaw(int rawID, RawIF editedRaw) throws ExceptionDB;

	boolean editProduct(int productID, ProductIF editedProduct)
			throws ExceptionDB;

	int increaseRaw(int rawID, int quant) throws ExceptionDB;

	int increaseProduct(int productID, int quant) throws ExceptionDB;

	long saveRaw(RawIF newRaw) throws ExceptionDB;

	SupplierIF getSupplierById(long supplierID) throws ExceptionDB,
			ExceptionLogic;

	long saveInput(InputIF input) throws ExceptionDB;

	long saveOutput(OutputIF output) throws ExceptionDB;

	boolean editInput(long inputID, InputIF editedInput) throws ExceptionDB;

	boolean removeInput(long inputID) throws ExceptionDB;

	boolean removeOutput(long outputID) throws ExceptionDB;

	boolean commit() throws ExceptionDB;

	boolean editOutput(int sessionID, long outputID, OutputIF editedOutput)
			throws ExceptionDB;

	UserIF getUserById(int userID) throws ExceptionDB, ExceptionLogic;

	boolean removePermission(int userID, String operation) throws ExceptionDB;

	boolean addPermission(int userID, String operation) throws ExceptionDB;

}
